package object;

import org.testng.Assert;
import org.testng.annotations.Test;

public class Instanceof1 {

    @Test
    public void t1() {
        String s1 = "";
        Assert.assertTrue(s1 instanceof String);
    }

    @Test
    public void t2() {
        A a = new A();
        a = new B();

        if (a instanceof B) {
            System.out.println("y");
        }

    }
}

class A {

}

class B extends A {

}
